//  import _ from 'lodash';
import { cube } from './math.js'
import './style.css';
// import Img from './blue2.jpg';
import printMe from './print.js'

function component() {
    // var element = document.createElement('div');
    var element = document.createElement('pre');
    // var btn = document.createElement('button')
    // Lodash（目前通过一个 script 脚本引入）对于执行这一行是必需的
    // element.innerHTML = _.join(['Hello', 'webpack', 'hui'], ' ');
    // element.classList.add('hello');
    // var myImg = new Image()
    // myImg.src = Img
    // element.appendChild(myImg)
    // btn.innerHTML = 'Click me and check the console  nonono!';
    // btn.onclick = printMe;

    // element.appendChild(btn);
    element.innerHTML = ['hello webpack', '5cubed is equal to' + cube(5)].join('\n\n')
    return element;
}

document.body.appendChild(component());


if (module.hot) {
    module.hot.accept('./print.js', function() {
        console.log('Accept the update printMe module')
        printMe()
    })
}